From 02b1cf005cf3e1df64183d20ba42930eb2767a9f Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Thu, 21 Aug 2025 06:57:36 +0000
Subject: (대표님, 최겸) 설계메뉴추가, 작업사항 업데이트 설계메뉴 - 문서관리
 설계메뉴 - 벤더 데이터 gtc 메뉴 업데이트 정보시스템 - 메뉴리스트 및 정보
 업데이트 파일 라우트 업데이트 엑셀임포트 개선 기본계약 개선 벤더 가입과정
 변경 및 개선 벤더 기본정보 - pq 돌체 오류 수정 및 개선 벤더 로그인 과정
 이메일 오류 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../(engineering)/document-list-only/page.tsx      | 98 ++++++++++++++++++++++
 1 file changed, 98 insertions(+)
 create mode 100644 app/[lng]/engineering/(engineering)/document-list-only/page.tsx

(limited to 'app/[lng]/engineering/(engineering)/document-list-only/page.tsx')

diff --git a/app/[lng]/engineering/(engineering)/document-list-only/page.tsx b/app/[lng]/engineering/(engineering)/document-list-only/page.tsx
new file mode 100644
index 00000000..5b49a6ef
--- /dev/null
+++ b/app/[lng]/engineering/(engineering)/document-list-only/page.tsx
@@ -0,0 +1,98 @@
+// evcp/document-list-only/page.tsx - 전체 계약 대상 문서 목록
+import * as React from "react"
+import { Suspense } from "react"
+import { Skeleton } from "@/components/ui/skeleton"
+import { type SearchParams } from "@/types/table"
+import { getValidFilters } from "@/lib/data-table"
+import { DocumentStagesTable } from "@/lib/vendor-document-list/plant/document-stages-table"
+import { documentStageSearchParamsCache } from "@/lib/vendor-document-list/plant/document-stage-validations"
+import { getDocumentStagesOnly } from "@/lib/vendor-document-list/plant/document-stages-service"
+
+interface IndexPageProps {
+  searchParams: Promise<SearchParams>
+}
+
+// 문서 테이블 래퍼 컴포넌트 (전체 계약용)
+async function DocumentTableWrapper({ 
+  searchParams
+}: { 
+  searchParams: SearchParams
+}) {
+  const search = documentStageSearchParamsCache.parse(searchParams)
+  const validFilters = getValidFilters(search.filters)
+
+  // 필터 타입 변환
+  const convertedFilters = validFilters.map(filter => ({
+    id: (filter.id || filter.rowId) as string,
+    value: filter.value,
+    operator: (filter.operator === 'iLike' ? 'ilike' :
+               filter.operator === 'notILike' ? 'notin' :
+               filter.operator === 'isEmpty' ? 'eq' :
+               filter.operator === 'isNotEmpty' ? 'ne' :
+               filter.operator === 'isBetween' ? 'eq' :
+               filter.operator === 'isRelativeToToday' ? 'eq' :
+               filter.operator || 'eq') as 'eq' | 'in' | 'ne' | 'lt' | 'lte' | 'gt' | 'gte' | 'like' | 'ilike' | 'notin'
+  }))
+
+  // evcp: 전체 계약 대상으로 문서 조회
+  const documentsPromise = getDocumentStagesOnly({
+    ...search,
+    filters: convertedFilters,
+  }, -1) // 세션에서 자동으로 도메인 감지
+
+  return (
+    <DocumentStagesTable
+      promises={Promise.all([documentsPromise])}
+      contractId={-1} // 전체 계약을 의미
+      projectType="plant" // 기본값으로 plant 사용
+    />
+  )
+}
+
+function TableLoadingSkeleton() {
+  return (
+    <div className="space-y-4">
+      <div className="flex items-center justify-between">
+        <Skeleton className="h-6 w-32" />
+        <div className="flex items-center gap-2">
+          <Skeleton className="h-8 w-20" />
+          <Skeleton className="h-8 w-24" />
+        </div>
+      </div>
+      <div className="rounded-md border">
+        <div className="p-4">
+          <div className="space-y-3">
+            {Array.from({ length: 5 }).map((_, i) => (
+              <div key={i} className="flex items-center space-x-4">
+                <Skeleton className="h-4 w-4" />
+                <Skeleton className="h-4 w-24" />
+                <Skeleton className="h-4 w-48" />
+                <Skeleton className="h-4 w-20" />
+                <Skeleton className="h-4 w-16" />
+                <Skeleton className="h-4 w-12" />
+              </div>
+            ))}
+          </div>
+        </div>
+      </div>
+    </div>
+  )
+}
+
+// 메인 페이지 컴포넌트
+export default async function DocumentStagesManagementPage({
+  searchParams
+}: IndexPageProps) {
+  const resolvedSearchParams = await searchParams
+
+  return (
+    <div className="mx-auto">
+      {/* 문서 테이블 */}
+      <Suspense fallback={<TableLoadingSkeleton />}>
+        <DocumentTableWrapper 
+          searchParams={resolvedSearchParams}
+        />
+      </Suspense>
+    </div>
+  )
+}
\ No newline at end of file
-- 
cgit v1.2.3

